import redis

# 连接到 Redis
r = redis.Redis(host='cc', port=16379, db=0, password="DRC@1234bank")


# 发布消息到频道
channel = 'stock_info_code'
message = 'update'
r.publish(channel, message)

print(f"消息 '{message}' 已发布到频道 '{channel}'。")

